#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtCore>
#include <QtWidgets>
#include <QMainWindow>
#include <QJsonObject>


namespace Ui {
class MainWindow;
}
class FlowScene;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void startup();
    void uiaddional();
    void loadalib();
    void slotFunc();
    void startupStrategy();
    bool loadFromFile(QString filePath);
    void createNew();  //创建一个新的，默认有根空节点.
    QString strValue(const QJsonObject& jobj, const QString &key);

    void loadDetailFromSelected();
private:
    Ui::MainWindow *ui;
    FlowScene *scene_;
    QMap<QString,QJsonObject> actionlib_;  //name->action的映射.
    QLabel *lbParams[6],*lbNexts[6];
    QLineEdit *leParam[6];
    QComboBox *cbNext[6];
};

#endif // MAINWINDOW_H
